package com.lzy.mall.auth.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * @author lzy
 * @date 2021/9/25 10:16
 */
@Data
public class UserRegisterVo {

    @Length(min = 6,max = 20,message = "用户名长度必须在6-20之间")
    @NotEmpty(message = "用户名必须提交")
    @ApiModelProperty(value = "用户名",required = true)
    private String userName;

    @Length(min = 6,max = 20,message = "用户名长度必须在6-20之间")
    @NotEmpty(message = "密码必须提交")
    @ApiModelProperty(value = "密码",required = true)
    private String password;

    @NotEmpty(message = "手机号不能为空")
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$", message = "手机号格式不正确")
    @ApiModelProperty(value = "手机号",required = true)
    private String phone;

    @NotEmpty(message = "验证码必须填写")
    @ApiModelProperty(value = "商品id",required = false)
    private String code;
}
